<%@page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="web" uri="http://meerkat.qunar.com/web"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<web:designCss/>
<%@include file="/WEB-INF/include/head.jsp" %>
</head>
<body>
<%-- sso用户没有修改密码的权限 --%>
<c:if test="${user.authType==0}">
<script>
$(document).ready(function(){
    try{
	Qadmin.FW.Dialog.alert({
	    msg: "SSO用户没有修改密码的权限!",
	    ok: function(){
		top.Qadmin.App.Panel.removeTab(Qadmin.FW.Url.getUrlParam('tid'));
	    }
	});
    }catch(e){}
});
</script>
</c:if>
<c:if test="${user.authType==1}">
    <div class="wrapper">
        <web:titleBar title="修改密码" />

        <div class="main content">
            <form id="changePwdForm">
        	<table class="comm_form_table">
        	    <tbody>
        		<tr>
        		    <td>用户名</td>
        		    <td><input type="text" disabled="disabled" id="name" name="name" value="${user.name}" /></td>
        		</tr>
        		<tr>
        		    <td>密码</td>
        		    <td><input type="text" id="password" name="password" value="" /></td>
        		</tr>
        	    </tbody>
        	    <tfoot>
        		<tr>
        		    <td colspan="2">
        			<input type="hidden" id="id" name="id" value="${user.id}" />
        			<input type="button" id="submit" class="button button-blue" value="提交" />
        		    </td>
        		</tr>
        	    </tfoot>
        	</table>
            </form>
        </div>
    </div>
    <script type="text/javascript">
	$(document).ready(function() {
	    $('#submit').click(function(){
		return Qadmin.FW.Ajax.post({
		    url: QG_CONFIG.PATH + 'user/changePwd.htm',
		    formId: "changePwdForm"
		});
	    });
	});
    </script>
</c:if>
</body>
</html>